/*
 * @Author: wangmyng wangmyng@163.com
 * @Date: 2025-10-25 22:30:31
 * @LastEditors: wangmyng wangmyng@163.com
 * @LastEditTime: 2025-11-01 21:47:50
 */
// src/App.tsx
import { HashRouter, Routes, Route, Navigate } from 'react-router-dom';
import { lazyLoad } from '@/utils/lazy';
import Layout from '@/layout/index'; // 你的布局组件

function App() {
  return (
    <HashRouter>
      <Routes>
        {/* 公共布局路由 */}
        <Route path="/" element={<Layout />}>
          {/* 首页重定向 */}
          <Route index element={<Navigate to="/home" replace />} />

          <Route path="/home" element={lazyLoad(() => import('@/pages/pc/Home'))} />
          <Route path="/realtime" element={lazyLoad(() => import('@/pages/pc/Realtime'))} />
          <Route path="/test-cim" element={lazyLoad(() => import('@/pages/pc/Test/cim'))} />
          <Route path="/test-camera" element={lazyLoad(() => import('@/pages/pc/Test/hik-camera-page'))} />
          {/* <Route path="/test-gis" element={lazyLoad(() => import('@/pages/pc/Test/gis'))} /> */}
        </Route>

        {/* 其他路由 */}
        <Route path="*" element={<Navigate to="/home" replace />} />
      </Routes>
    </HashRouter>
  );
}

export default App;